package com.heima.demo7;

public class Demo {
    public static void main(String[] args) {
        MyThread1 myThread1 = new MyThread1();
        MyThread2 myThread2 = new MyThread2();
        myThread1.setName("女神");
        myThread2.setName("备胎");
        //把第二个线程设置为守护线程
        //当普通线程执行完之后,那么守护线程也没有继续运行下去的必要了.
        myThread2.setDaemon(true);
        myThread1.start();
        myThread2.start();
    }
}
